package com.market.plus.core.model;

import com.market.plus.core.dto.ParticipantDto;
import com.opm.security.core.model.ExternalUserDetailsImpl;

public class CustomUserDetailsImpl extends ExternalUserDetailsImpl implements CustomUserDetails {

   private static final long serialVersionUID = 1L;

   private ParticipantDto guest;

   private ParticipantDto currentLogin;

   public boolean hasGuestWindow(){ 
      if (guest == null)
         return false;
      boolean hasSameUser = !(currentLogin.getId().longValue() == guest.getId().longValue());
      return hasSameUser;
   }

   public void setCurrentViewUser(ParticipantDto participantDto) {
      this.guest = participantDto;
   }

   public void setCurrentLoginUser(ParticipantDto participantDto) {
      currentLogin = participantDto;
   }

   public ParticipantDto getCurrentLoginUser(){
      return currentLogin;
   }

   public ParticipantDto getCurrentViewUser() {
      return guest;
   }
}
